/**
 * @author Kristian Mandrup
 * @date June 10, 2009
 * @version 0.1
 * 
 * jsTree.generator :: WrapperSetup
 * 
 * - Sets up wrappers for the m3gen components 
 */

// === LogWrapper ===
/*
 * The logWrapper is here set up to wrap all m3gen component execute functions with a call to the eventHandler
 * with a 'begin method' event just before the call and a 'completed method' event just after it returns
 */

m3gen.logWrapExecute = function(context, options) {
	m3gen.LogWrapper.log({
		context: context, 
		method: context.doExecute,
		args: options,
		name: 'execute'
	});	
}

// JsTreeModelGenerator

/**
* LogWrapper doExecute
* @param {Object} options
*/
m3gen.JsTreeModelGenerator.prototype.execute = function(options){
	m3gen.logWrapExecute(this, options);
}

// NodeObjBuilder

/**
* LogWrapper doExecute
* @param {Object} options
*/
m3gen.NodeObjBuilder.prototype.execute = function(options){
	m3gen.logWrapExecute(this, options);
}

// NodeObjBranchBuilder

/**
* LogWrapper doExecute
* @param {Object} options
*/
m3gen.NodeObjBranchBuilder.prototype.execute = function(options){
	m3gen.logWrapExecute(this, options);
}

// JsTreeNodeContent builders

// AttributesBuilder

/**
* LogWrapper doExecute
* @param {Object} options
*/
m3gen.jsTreeNode.AttributesBuilder.prototype.execute = function(options){
	m3gen.logWrapExecute(this, options);
}

// ChildrenBuilder

/**
* LogWrapper doExecute
* @param {Object} options
*/
m3gen.jsTreeNode.ChildrenBuilder.prototype.execute = function(options){
	m3gen.logWrapExecute(this, options);
}

// DataBuilder

/**
* LogWrapper doExecute
* @param {Object} options
*/
m3gen.jsTreeNode.DataBuilder.prototype.execute = function(options){
	m3gen.logWrapExecute(this, options);
}

// MetaDataBuilder

/**
* LogWrapper doExecute
* @param {Object} options
*/
m3gen.jsTreeNode.MetaDataBuilder.prototype.execute = function(options){
	m3gen.logWrapExecute(this, options);
}

// StateBuilder

/**
* LogWrapper doExecute
* @param {Object} options
*/
m3gen.jsTreeNode.StateBuilder.prototype.execute = function(options){
	m3gen.logWrapExecute(this, options);
}

